/**
 * Created by clown on 2016/1/17.
 */


(function($){
	//找资金  信息
	var moneyHtml = $("#detail_project_title").html();
	//alert(detailHtml)
	if(!!window.sessionStorage.getItem("investId")){
			var investId = window.sessionStorage.getItem("investId");
	}
	var moneyTpl= Handlebars.compile(moneyHtml);
	var id=2;
	var moneyProject = function(){
		$.get("lt/investor/detail?userId=" + investId,function(data){
			if(!data.result){
				//alert(id)
				$(".find_for_money_cont_info_box").html(moneyTpl(data));
			}
		});
	};
	moneyProject();
	//找资金  投资机构
	var compHtml = $("#detail_project_comp").html();
	//alert(detailHtml)
	var compTpl= Handlebars.compile(compHtml);
	var compProject = function(){
		$.get("lt/investor/detail?userId=" + investId,function(data){
			if(!data.result){
				//alert(JSON.stringify(data.data.investCase));
				data.data.investCase = JSON.parse(data.data.investCase);
				$(".find_for_money_cont_tzll_box").html(compTpl(data.data));
				$(".find_for_money_cont_tzll_cont:last").css("border-bottom","none");
				//alert(1)
				//console.log(data.investCase)
			}
		});
	};
	compProject();
	//找资金  附加价值
	var jzHtml = $("#detail_project_jz").html();
	//alert(detailHtml)
	var jzTpl= Handlebars.compile(jzHtml);
	var jzProject = function(){
		$.get("lt/investor/detail?userId=" + investId,function(data){
			if(!data.result){
				//alert(id)
				$(".find_for_money_cont_fj_box").html(jzTpl(data));
				//console.log(data.investCase)
			}
		});
	};
	jzProject();


})(jQuery);